<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <meta name="author" content="Openshift Assisted Service Team">
  
  <link rel="shortcut icon" href="../../img/favicon.ico">
  <title>OCP Deployment on Bare Metal - Openshift Assisted Service</title>
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700" />

  <link rel="stylesheet" href="../../css/theme.css" />
  <link rel="stylesheet" href="../../css/theme_extra.css" />
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css" />
  
  <script>
    // Current page data
    var mkdocs_page_name = "OCP Deployment on Bare Metal";
    var mkdocs_page_input_path = "user-guide/deploy-on-bare-metal.md";
    var mkdocs_page_url = null;
  </script>
  
  <script src="../../js/jquery-2.1.1.min.js" defer></script>
  <script src="../../js/modernizr-2.8.3.min.js" defer></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
  <script>hljs.initHighlightingOnLoad();</script> 
  
</head>

<body class="wy-body-for-nav" role="document">

  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
    <div class="wy-side-scroll">
      <div class="wy-side-nav-search">
        <a href="../.." class="icon icon-home"> Openshift Assisted Service</a>
        <div role="search">
  <form id ="rtd-search-form" class="wy-form" action="../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" title="Type search term here" />
  </form>
</div>
      </div>

      <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../..">OAS Home</a>
                    </li>
                </ul>
                <p class="caption"><span class="caption-text">OAS Deployment</span></p>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../assisted-service-on-local/">OAS Running on Local</a>
                    </li>
                    <li class="toctree-l1"><a class="reference internal" href="../assisted-service-on-openshift/">OAS Running on Openshift</a>
                    </li>
                </ul>
                <p class="caption"><span class="caption-text">Openshift Deployment</span></p>
                <ul class="current">
                    <li class="toctree-l1"><a class="reference internal" href="../user-guide/">User Guide Index</a>
                    </li>
                    <li class="toctree-l1"><a class="reference internal" href="../deploy-on-local/">OCP Deployment on Local</a>
                    </li>
                    <li class="toctree-l1 current"><a class="reference internal current" href="./">OCP Deployment on Bare Metal</a>
    <ul class="current">
    <li class="toctree-l2"><a class="reference internal" href="#general">General</a>
    </li>
    <li class="toctree-l2"><a class="reference internal" href="#ipxe">iPXE</a>
        <ul>
    <li class="toctree-l3"><a class="reference internal" href="#automatic">Automatic</a>
    </li>
    <li class="toctree-l3"><a class="reference internal" href="#manual">Manual</a>
    </li>
    <li class="toctree-l3"><a class="reference internal" href="#booting-the-nodes-from-ipxe">Booting the nodes from iPXE</a>
    </li>
        </ul>
    </li>
    </ul>
                    </li>
                    <li class="toctree-l1"><a class="reference internal" href="../deploy-on-vsphere/">OCP Deployment on vSphere</a>
                    </li>
                    <li class="toctree-l1"><a class="reference internal" href="../deploy-on-RHEV/">OCP Deployment on RHEV</a>
                    </li>
                    <li class="toctree-l1"><a class="reference internal" href="../deploy-on-OSP/">OCP Deployment on Openstack</a>
                    </li>
                </ul>
                <p class="caption"><span class="caption-text">OAS Development</span></p>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../../dev/migrations/">Migrations</a>
                    </li>
                </ul>
      </div>
    </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
        <a href="../..">Openshift Assisted Service</a>
      </nav>

      
      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="breadcrumbs navigation">
  <ul class="wy-breadcrumbs">
    <li><a href="../..">Docs</a> &raquo;</li>
    
      
        
          <li>Openshift Deployment &raquo;</li>
        
      
    
    <li>OCP Deployment on Bare Metal</li>
    <li class="wy-breadcrumbs-aside">
      
    </li>
  </ul>
  
  <hr/>
</div>
          <div role="main">
            <div class="section">
              
                <h1 id="openshift-deployment-with-oas-on-bare-metal">Openshift deployment with OAS - On Bare Metal</h1>
<p>This guide contains all the sections regarding Bare Metal deployment method, like iPXE/PXE, VirtualMedia, etc... let's get started</p>
<h2 id="general">General</h2>
<p>This section is generic for the most of the cases:</p>
<ul>
<li>DHCP/DNS running on the network you wanna deploy the OCP cluster.</li>
<li>Assisted Installer up &amp; running (It's ok if you're working with cloud version).</li>
<li>Typical DNS entries for API VIP and Ingress VIP.</li>
<li>Pull Secret to reach the OCP Container Images.</li>
<li>SSH Key pair.</li>
</ul>
<p><em><em>Note</em>: This method could be used also in Virtual environment</em></p>
<ul>
<li>With that we could start, first step is create the cluster</li>
<li>Fill the Cluster name and Pull Secret fields, also select the version you wanna deploy:</li>
</ul>
<p><img alt="img" src="../img/new_cluster.png" /></p>
<ul>
<li>Now fill the Base Domain field and the SSH Host Public Key</li>
</ul>
<p><img alt="img" src="../img/entry_base_domain.png" />
<img alt="img" src="../img/entry_ssh_pub_key.png" /></p>
<ul>
<li>Click on <em>Download Discovery ISO</em></li>
</ul>
<p><img alt="img" src="../img/entry_ssh_pub_key.png" /></p>
<ul>
<li>Fill again the SSH public key and click on <em>Generate Discovery ISO</em></li>
</ul>
<p><img alt="img" src="../img/entry_ssh_download_discovery.png" /></p>
<ul>
<li>Wait for ISO generation to finish and you will reach this checkpoint</li>
</ul>
<p><img alt="img" src="../img/discovery_iso_generated.png" /></p>
<h2 id="ipxe">iPXE</h2>
<p>iPXE deployment method</p>
<p><em>NOTE1</em>: We use a sample URL, please change to fit your use case accordingly
<em>NOTE2</em>: We've set the live_url as the node hostname on 8080 port , please change to fit your use case accordingly</p>
<h3 id="automatic">Automatic</h3>
<p>The automatic way is done using podman, just follow this steps:</p>
<pre><code class="language-shell">export IPXE_DIR=/tmp/ipxe/ai
mkdir -p ${IPXE_DIR}

# This command will download the ISO, extract the Images and create the ignition config files
podman run -e BASE_URL=http://devscripts2ipv6.e2e.bos.redhat.com:8080 -e ISO_URL=http://devscripts2ipv6.e2e.bos.redhat.com:6008/api/assisted-install/v1/clusters/33ffb056-ee65-4fee-91c9-f60e5ebea4a3/downloads/image -v /tmp/ipxe/ai:/data:Z --net=host -it --rm quay.io/ohadlevy/ai-ipxe

# This command will host the iPXE files on an podman container
podman run  -v ${IPXE_DIR}:/app:ro -p 8080:8080 -d --rm bitnami/nginx:latest
</code></pre>
<p>To ensure if your container is working fine, check the url with a <code>curl</code> command</p>
<pre><code class="language-shell">curl http://$(hostname):8080/ipxe/ipxe
</code></pre>
<h3 id="manual">Manual</h3>
<p>The manual way is explained here. You need at least to have the Discovery ISO already generated</p>
<p>Now let's download that ISO in the provisioning machine, where the iPXE files will be hosted (use the <em>Command to download the ISO</em> button from the Assisted Service website</p>
<pre><code class="language-shell">export IPXE_DIR=/tmp/ipxe/ai
export IMAGE_PATH=/tmp/discovery_image_ocp.iso

wget -O ${IMAGE_PATH} 'http://cloud.redhat.com/api/assisted-install/v1/clusters/&lt;cluster_id&gt;/downloads/image'
</code></pre>
<ul>
<li>Now we need to create the folder and the <em>ipxe</em> file definition</li>
</ul>
<pre><code class="language-shell">mkdir -p ${IPXE_DIR}

cat &gt; $IPXE_DIR/ipxe &lt;&lt; EOF
#!ipxe                                                                                                                                                                                    
set live_url $(hostname):8080
kernel \${live_url}/vmlinuz ignition.config.url=\${live_url}/config.ign coreos.live.rootfs_url=\${live_url}/rootfs.img ${KERNEL_OPTS}
initrd \${live_url}/initrd.img
boot       
EOF
</code></pre>
<ul>
<li>We also need to extract the images from the ISO</li>
</ul>
<pre><code class="language-shell">export PXE_IMAGES=`isoinfo -i $IMAGE_PATH -f | grep -i images/pxeboot`

for img in $PXE_IMAGES; do
  export name=`basename ${img,,} | sed 's/\;1//' | sed 's/\.$//'`
  echo extracting $name
  isoinfo -i $IMAGE_PATH -x $img &gt; $IPXE_DIR/$name
done
</code></pre>
<ul>
<li>And as a last step, write the Ignition files for the deployment</li>
</ul>
<pre><code class="language-shell">echo writing custom user ignition
echo '{' &gt; $IPXE_DIR/config.ign
isoinfo -i $IMAGE_PATH -x '/IMAGES/IGNITION.IMG;1' | xz -dc - | sed '1d; $d' &gt;&gt; $IPXE_DIR/config.ign
echo '}' &gt;&gt; $IPXE_DIR/config.ign
</code></pre>
<ul>
<li>After the Ignition files creation we need to host the files, for that we will use a podman contianer based on nginx</li>
</ul>
<pre><code class="language-shell">podman run  -v ${IPXE_DIR}:/app:ro -p 8080:8080 -d --rm bitnami/nginx:latest
</code></pre>
<ul>
<li>To ensure if your container is working fine, check the url with a <code>curl</code> command</li>
</ul>
<pre><code class="language-shell">curl http://$(hostname):8080/ipxe/ipxe
</code></pre>
<h3 id="booting-the-nodes-from-ipxe">Booting the nodes from iPXE</h3>
<ul>
<li>First step, we need to set up the boot mode on the iDrac's as <code>boot once</code> for iPXE, this will depend on the steps on every Bare Metal Manufacturer/Version/Hardware.</li>
<li>When you are booting the nodes, stay tuned to press <code>crtl-b</code> when the prompt say that:</li>
</ul>
<p><img alt="img" src="../img/iPXE_boot.png" /></p>
<ul>
<li>Now we need to get a correct IP and point to the right iPXE file</li>
<li>And we just need to wait until the boot was finished, and the nodes start appearing on the Assisted Service interface</li>
</ul>
<p><img alt="img" src="../img/manual_ipxe_boot.png" /></p>
<p><img alt="img" src="../img/boot_from_ipxe.gif" /></p>
<ul>
<li>Then we will modify the nodename to use a right name for Openshift</li>
</ul>
<p><img alt="img" src="../img/ai_node_appear.gif" /></p>
<ul>
<li>Create another 2 more nodes and repeat this step</li>
</ul>
<p><img alt="img" src="../img/ai_all_nodes.png" /></p>
<ul>
<li>Now fill the <em>API Virtual IP</em> and <em>Ingress Virtual IP</em> fields</li>
</ul>
<p><img alt="img" src="../img/ai_vips.png" /></p>
<ul>
<li>Now you just need to click on <em>Install Cluster</em> button and wait for the installation to finish.</li>
</ul>
              
            </div>
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="../deploy-on-vsphere/" class="btn btn-neutral float-right" title="OCP Deployment on vSphere">Next <span class="icon icon-circle-arrow-right"></span></a>
      
      
        <a href="../deploy-on-local/" class="btn btn-neutral" title="OCP Deployment on Local"><span class="icon icon-circle-arrow-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <!-- Copyright etc -->
    
  </div>

  Built with <a href="https://www.mkdocs.org/">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
      
        </div>
      </div>

    </section>

  </div>

  <div class="rst-versions" role="note" aria-label="versions">
    <span class="rst-current-version" data-toggle="rst-current-version">
      
          <a href="https://github.com/openshift/assisted-service" class="fa fa-github" style="float: left; color: #fcfcfc"> GitHub</a>
      
      
        <span><a href="../deploy-on-local/" style="color: #fcfcfc;">&laquo; Previous</a></span>
      
      
        <span style="margin-left: 15px"><a href="../deploy-on-vsphere/" style="color: #fcfcfc">Next &raquo;</a></span>
      
    </span>
</div>
    <script>var base_url = '../..';</script>
    <script src="../../js/theme.js" defer></script>
      <script src="../../search/main.js" defer></script>
    <script defer>
        window.onload = function () {
            SphinxRtdTheme.Navigation.enable(true);
        };
    </script>

</body>
</html>
